package com.dyz.swordFingerOffer;

/**
 * @author: daiyizheng
 * @date: 2021/5/28 21:48
 * @description:
 */
public class jumpFloor10x3 {


    public int jumpFloor(int target) {


        //f(n) = f(n-1)+f(n-2)+....+f(1)
        //f(n-1) = f(n-2)+f(n-3)+...+f(1)
        //f(n) = 2f(n-1)
        //f(n) = 2*2f(n-2)
        //f(n) = 2^(n-1)f(1)
        if(target==1 || target==0){
            return 1;
        }else{
            int res=1;
            for (int i=0;i<target-1;i++){
                res = 2* res;
            }
            return res;
        }
    }
}
